<template>
  <div class="sk-page">
    <simple-table
      ref="simple-table"
      :table-column="tableColumn"
      :table-data="tableData"
      :table-page-info="tablePageInfo"
      :table-data-count="tableDataTotalCount"
      @page-info-change="handlePageInfoChange"
      @sort-change="handleSortChange"
    >
            <simple-form
                v-model="searchModel.query"
                :form-field="searchFormField"
                label-width="120px"
                :grid="{ span: 6 }"
            >
                <template slot="tableOperation">
                <el-button
                    type="primary"
                    @click="handleDataSearch"
                >
                    查询
                </el-button> 
                </template>
                </simple-form>
       </simple-table>
    </div>
</template>
<script>
// import simpleForm from '@/components/base/simple-form'
/** 混入分页信息及数据总数信息 */
import pageMixins from '@/components/base/simple-table/mixin'
export default {
    name:'search',
    // components: { simpleForm },
    mixins: [pageMixins],
    data (){
        return{
            currentShowFlag:true,
            searchModel: {
            query: {
                query:''
            },
            include: ['path']
            },
            tableData:[],
            selections: []
        }
    },
    computed: {
      tableColumn() {
      return [
        { label: '文件名', prop: 'active', width: 100, sortable: 'custom'},
        { label: '文件路径', prop: 'mark', width: 120, sortable: 'custom' },
        { label: '修改者', prop: 'property', width: 100, sortable: 'custom' },
        { label: '修改时间', prop: 'period', width: 120, sortable: 'custom' },
        { label: '创建者', prop: 'property', width: 100, sortable: 'custom' },
        { label: '创建时间', prop: 'period', width: 120, sortable: 'custom' }
      ]
     },
    searchFormField () {
      return [
        {
          prop: 'query',
          label: '文件名称',
          type: 'Input',
          labelWidth: '80px',
          col: { span: 12 }
        },
        // {
        //   prop: 'property',
        //   label: '状态',
        //   type: 'Select',
        //   hideCode: true,
        //   component: { optionList: this.$getDictList('version_property'), filterable: true, clearable: true }
        // },
        // {
        //   prop: 'active',
        //   label: 'asdad',
        //   type: 'Select',
        //   hideCode: true,
        //   component: { optionList: this.$getDictList('data_status'), filterable: true, clearable: true }
        // },
        // {
        //   prop: 'period',
        //   label: 'period',
        //   type: 'Input',
        //   hideCode: true,
        //   labelWidth: '170px',
        //   component: { filterable: true, clearable: true }
        // },
        { slotName: 'tableOperation', col: { span: 24, style: { textAlign: 'right' } }, labelWidth: '0' }
      ]
     }
    },
    methods:{
     handleDataSearch(){
            this.$axios
            .post('http://122.112.188.48:18001/alfresco/api/-default-/public/search/versions/1/search', this.searchModel)
            .then(resp => {
                debugger
              this.tableData = resp.data.list.entries
              console.log(resp.data.list.entries)
              console.log(this.tableData)
              this.currentShowFlag = false 
            })
            .finally(() => {
              loadingFlag.close()
            })
     },
    handleSelectionChange (selections) {
      this.selections = selections
    },
    handleClick(){
        
    }
    }
}
</script>
<style scoped>
  
  .bg-purple {
    background: #d3dce6;
  }

  .grid-content {
    border-radius: 4px;
    min-height: 36px;
  }

  
</style>
